Skip to content

feat: add delete functionality for walls, slabs and other structural elements#193

Closed
hellozzm wants to merge 1 commit into
pascalorg:mainfrom
hellozzm:fix/issue-156
Closed

feat: add delete functionality for walls, slabs and other structural elements#193
hellozzm wants to merge 1 commit into
pascalorg:mainfrom
hellozzm:fix/issue-156

Conversation

@hellozzm

Copy link
Copy Markdown

Summary

Add ability to delete structural elements (walls, slabs, ceilings, doors, windows, items, zones, roofs) when the editor is in delete mode (shortcut: D).

The delete mode button already existed in the UI toolbar but had no handler — clicking on elements did nothing.

Changes

  • New DeleteTool component (packages/editor/src/components/tools/delete-tool.tsx)

    • Listens to click events on all deletable node types via the event bus
    • Validates the clicked node belongs to the current level/zone selection
    • Calls useScene.deleteNode() to remove the node
    • Plays appropriate SFX (item-delete or structure-delete)
  • Updated ToolManager to render DeleteTool when mode is delete

Testing

  1. Open the editor and switch to Structure phase
  2. Click the Delete mode button (trash icon) or press D
  3. Click on a wall, slab, or other structural element → it should be deleted
  4. Verify undo (Ctrl+Z) restores the deleted element
  5. Verify delete only works on elements in the selected level/zone

Fixes #156

Add DeleteTool component that activates when the editor is in 'delete'
mode (shortcut: D). Clicking on any structural element (wall, slab,
ceiling, door, window, item, zone, roof) removes it from the scene.

- New DeleteTool component with click handlers via event bus
- Validates clicked node belongs to a deletable type
- Integrates with existing tool-manager and building-local group
- Resolves conflicts with upstream's building transform refactor
@Aymericr

Copy link
Copy Markdown
Contributor

Thank you for this! Since this PR was opened, delete mode has been fully implemented on main — the selection manager now handles click-to-delete (the 'sledgehammer' tool, D) for walls, slabs and other structural elements, with delete-hover highlighting and SFX feedback. So a separate delete tool would duplicate the existing behavior. Closing as superseded — but genuinely appreciate the contribution and the clear write-up.

@Aymericr Aymericr closed this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to delete structures? (walls, slabs?)

2 participants